//package com.maoxs.controller;
//
//import org.springframework.core.annotation.AnnotationUtils;
//import org.springframework.web.bind.annotation.ControllerAdvice;
//import org.springframework.web.bind.annotation.ExceptionHandler;
//import org.springframework.web.bind.annotation.ResponseBody;
//import org.springframework.web.bind.annotation.ResponseStatus;
//
//import javax.servlet.http.HttpServletRequest;
//
////@ControllerAdvice
////@ResponseBody
//public class MyExceptionHandler {
//    @ExceptionHandler(Exception.class)
//    public String handleException(HttpServletRequest req, Exception e) throws Exception {
//        e.printStackTrace();
//        if (AnnotationUtils.findAnnotation(e.getClass(), ResponseStatus.class) != null) {
//            throw e;
//        }
//        return "出错了ExceptionHandler";
//    }
//}
